#ifndef __scene_manager__h__
#define __scene_manager__h__

#include "singleton.h"
#include "common.h"
#include <vector>
using namespace std;

struct cpSpace;
class hgeSprite;
class hgeFont;
class entity;
struct hgeQuad;

struct goal_info
{
	hgeSprite* sprite;
	int_pair pos;
	int width;
	int height;
};

enum
{
	SCREEN_NORMAL = 0,
	SCREEN_FADE_IN = 1,
	SCREEN_FADE_OUT = 2
};

class scene_manager : public singleton<scene_manager>
{
public:
	scene_manager();
	~scene_manager();

    //load scene
	bool load_scene(char* scenefile);

	//render function
	static bool scene_render();

	//
    void render_bg();

	//
	void render_goal();

	//
	void render_entitys();

	//
	void render_fps();

	//
	void render_keep_time();

	//
	entity* get_goal_entity();

	//
	void clear_scene();

	//
	void set_screen_fade_inout(int gfx);

	//
	void do_screen_fade_inout();

    //
	goal_info* get_goal_info();

private:
	hgeQuad* quad;
	int screen_gfx_state;
	float quad_transparent;
	float screen_gfx_speed;
	hgeSprite* bg;
	hgeSprite* notice;
	goal_info* g;
	entity* goal_entity;
	hgeFont* fnt;
	vector<entity*> entitys;
	bool first_init;
};

#endif